package teaching.io.advance;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;

/**
 * 字符缓冲输入流的示例。
 * 
 * @author deng.zhao
 * @version 1.0 2018/03/28
 *
 */
public class BufferedReaderExample {

	public static void main(String[] args) {
		
		String str = null;

		try (FileReader fr = new FileReader("d:/test.txt"); BufferedReader bw = new BufferedReader(fr);) {			
			while ((str = bw.readLine()) != null) {
				System.out.println(str);
			}
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}

		System.out.println("DONE!");
	}

}
